home *** CD-ROM | disk | FTP | other *** search
- Path: news.iag.net!news
- From: jatmon@iag.net (John R Buchan)
- Newsgroups: comp.lang.c
- Subject: Re: Please help ?!
- Date: 20 Jan 1996 22:25:54 GMT
- Organization: Internet Access Group, Orlando, Florida
- Message-ID: <4drq5i$cr@news.iag.net>
- References: <4dm889$3hs@neptunus.pi.net> <4drnv1$cr@news.iag.net>
- NNTP-Posting-Host: pm1-orl30.iag.net
- X-Newsreader: WinVN 0.99.7
-
- In article <4drnv1$cr@news.iag.net>, jatmon@iag.net says...
- >
- >In article <4dm889$3hs@neptunus.pi.net>, mv@pi.net says...
- >>
- >>Hello everybody,
- >>
- >>
- >>Please take a look at this:
- ><code snipped>
- >
- >Below is a modified version of the posted code. All comments are mine
- ><hint about need for comments> and usually refer to modifications I have
- made.
- >
- <snip>
-
- Oops. I missed a couple of things.
-
- > /* Why malloc? You could just define saved as char saved[MAXLEN]; */
- > /* and set cpy = saved */
- > cpy = (char *) malloc(MAXLEN);
-
- The cast is unnecessary and can hide errors. You should remove it.
-
- <snip>
- > /* if (!strchr("/-\0", *cmd)) make this an else. no conditions needed
- */
- > else
- > {
- > *cmd++;
-
- I believe you only intend to increment cmd here. Do not use the dereference
- operator. It serves no purpose.
-
- cmd++;
-
-
- --
- John R Buchan -:|:- Looking for that elusive FAQ? ftp to:
- jatmon@mail.iag.net -:|:- rtfm.mit.edu /pub/usenet-by-group/....
-
-